<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<?php 
	$buyer = $items['buyer'];
	$ci = &get_instance();
?>
<div id="center-wrap" class="ui-corner-tl ui-corner-tr">
	<div id="navigation" class="ui-corner-all"><ul><?php echo $navigator;?></ul></div>
	
	<div class="clrboth"></div>
	
	<div class="row" id="tabs">
		<ul>
			<li><a href="#tabs-acc">Account Information</a></li>
			<li><a href="#tabs-bids">Won Bids</a></li>
		</ul>
		
		<div class="clrboth"></div>
		
		<div class="column grid_9" id="tabs-acc">
			
			<div class="column grid_2">First name:</div>
			<div class="column grid_6"><?php echo $buyer->getFirstName();?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Last name:</div>
			<div class="column grid_6"><?php echo $buyer->getLastName();?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Job title:</div>
			<div class="column grid_6"><?php echo $buyer->getJobTitle();?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Country:</div>
			<div class="column grid_6"><?php echo $buyer->getCountry();?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Address Line 1:</div>
			<div class="column grid_6"><?php echo $buyer->getAddressLine1();?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Address Line 2:</div>
			<div class="column grid_6"><?php echo $buyer->getAddressLine2();?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Zip (postal code):</div>
			<div class="column grid_6"><?php echo $buyer->getCity();?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">State:</div>
			<div class="column grid_6"><?php echo $buyer->getState();?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Zip:</div>
			<div class="column grid_6"><?php echo $buyer->getZip();?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Show Type:</div>
			<div class="column grid_6">
			<?php 
			if(($buyer->getShowType())){
				$array = showTypeDataConfig(); 
				$array2 = array();
				foreach(explode(',',$buyer->getShowType()) as $element){
					$array2[] = $array[$element];
				}
				echo implode(', ',$array2);
			}	
			?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Country of Origin:</div>
			<div class="column grid_6">
			<?php 
			if(($buyer->getCountryOrigin())){
				$array = countryOriginDataConfig(); 
				$array2 = array();
				foreach(explode(',',$buyer->getCountryOrigin()) as $element){
					$array2[] = $array[$element];
				}
				echo implode(', ',$array2);
			}	
			?></div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Music Genre:</div>
			<div class="column grid_6">
			<?php 
			if(($buyer->getMusicGenre())){
				$array = musicGenreDataConfig(); 
				$array2 = array();
				foreach(explode(',',$buyer->getMusicGenre()) as $element){
					$array2[] = $array[$element];
				}
				echo implode(', ',$array2);
			}	
			?></div>
			
			
			<div class="clrboth"></div>
		</div>
		
		<div class="clrboth"></div>
		
		<div class="column grid_9" id="tabs-bids">
			<div id="result_display" style="width:840px;">
				<table>
					<thead>
						<td width="100px">Show Ref</td>
						<td width="200px">Artist</td>
						<td width="100px">Amount</td>
						<td width="100px">Date Bid</td>
					</thead>
					<tbody>
					 
						<?php if(!empty($items['bid'])):?>
							<?php foreach($items['bid'] as $object):?>
								<?php 
									$SHOW = $ci->show_entity->init('ref_no', $object->show_ref_no) ;
									$BID = $ci->bid_entity->init('id', $object->id);
								?>
								<tr>
									<td><a href="<?php echo site_url("seller/show_details/".$SHOW->getRefNo());?>"><?php echo $SHOW->getRefNo();?></a></td>
									<td><?php echo $SHOW->getArtist();?></td>
									<td><?php echo $BID->getOfferPrice();?></td>
									<td><?php echo sbxDateFormat($BID->getDateBid(), 'd/M/Y');?></td>
								</tr>
							<?php endforeach; ?>
						<?php endif; ?>
					</tbody>
				</table>
			</div>
			
		</div>
	</div>
</div>
<div class="clrboth"></div>

<script type="text/javascript">
	$(function() {
		$( "#tabs" ).tabs({ selected: 0 });
	});
</script>

